<?php

namespace App\Http\Controllers\Tools;

use App\Http\Common\FilesTools;
use App\Http\Common\Globals;
use App\Http\Common\MyUtils;
use App\Http\Common\Sms;
use App\Http\Controllers\BaseController;

/**
 * 发送短信息的公共接口
 * Class SendMessageController
 * @package App\Http\Controllers\FrontCity\tools
 */
class SendMessageController extends BaseController
{
    /**
     * 发送短信息
     * @return bool
     */
    public function sendMessageCode (){
        $res = Sms::getInstance()->sendMessageCodeOne(MyUtils::sg($this->request,'phone'));
        if ($res){
            return MyUtils::dealFD("验证码已经发送到手机，请注意查收，过期时间5分钟！",1);
        }else{
            return MyUtils::dealFD("验证码发送失败！".Globals::$error,-1);
        }
    }
}
